<?php use_stylesheet('order.css') ?>
<?php
slot('title', sprintf('Order name: %s', $order->getOrdername()))
?>
<br></br>
<table id="order_details">
  <tbody>
    <tr>
      <th>Order identifier</th>
      <td><?php echo $order->getIdorder() ?></td>
    </tr>
    <tr>
      <th>Order name</th>
      <td><?php echo $order->getOrdername() ?></td>
    </tr>
    <tr>
      <th>Text category</th>
      <td><?php echo $order->getTextcategories(); ?></td>
    </tr>
    <tr>
      <th>Media</th>
      <td colspan="5">
        <table>
          <?php
          foreach ($order->getOrdermedias() as $media) {
            ?>
            <td>
              <?php
              echo $media->getMedia();
              ?>
            </td>
            <?php
          }
          ?>
        </table>
      </td>
    <tr>
      <th>Target group</th>
      <td>
        <table>
          <th>
          <?php echo $order->getTargetgroup() ?>
            </th>
            <td>
              <table>
                <?php
                foreach ($order->getOptionalgroupsorders() as $optionalGroup) {
                  ?>
                  <td>
                    <?php
                    echo $optionalGroup->getOptionaltargetgroups();
                    ?>
                  </td>
                  <?php
                }
                ?>
              </table>
              
              
            </td>
          </table>
      </td>
    </tr>
   
    
    <tr>
      <th>Style</th>
      <td><?php echo $order->getFormalstyle() ?></td>
    </tr>
    <tr>
      <th>Person style</th>
      <td><?php echo $order->getPersonstyle() ?></td>
    </tr>
    <tr>
      <th>Emotion style</th>
      <td><?php echo $order->getEmotionstyle() ?></td>
    </tr>
    <tr>
      <th>Formulate</th>
      <td><?php echo $order->getFormulatetext() ?></td>
    </tr>
    <tr>
      <th>Structure</th>
      <td>
              <table>
                <?php
                foreach ($order->getStructureorders() as $structure) {
                  ?>
                  <th>
                    <?php
                    echo $structure->getStructure()->getTitle();
                    ?>
                  </th>
                  <td>
                    <?php
                    echo $structure->getStructure()->getText();
                    ?>
                  </td>
                  <?php
                }
                ?>
              </table>
      </td>
    </tr>
    <tr>
      <th>Image</th>
      <td>
        <img src="/uploads/orders/<?php echo $order->getUrlimage() ?>" alt="<?php echo $order->getOrdername() ?> Image" />        
        <?php //echo $order->getUrlimagestructure()  ?>
      </td>
    </tr>
    <tr>
      <th>Standard</th>
      <td>
        <?php
        if ($order->getEditionoptionsorders() == null) {
          echo "&#x2713;";
        } else {
          echo "x";
        }
        ?></td>
    </tr>
    <tr>
      <th>Edition options</th>
      <td colspan="5">
        <?php 
        
        foreach($order->getEditionoptionsorders() as $editionOption){
          echo $editionOption->getEditionoptions()."\n";
        }
        
        ?>
      </td>

    </tr>
    <tr>
      <th>Excluded words</th>
      <td><?php echo $order->getExcludedwords() ?></td>
    </tr>
    <tr>
      <th>Created at</th>
      <td><?php echo $order->getCreatedAt() ?></td>
    </tr>
    <tr>
      <th>Expires at</th>
      <td><?php echo $order->getExpiresAt() ?></td>
    </tr>
    <tr>
      <th>Updated at</th>
      <td><?php echo $order->getUpdatedAt() ?></td>
    </tr>
  </tbody>
</table>
<br></br>
<hr />

<a href="<?php echo url_for('order/edit?idOrder='.$order->getIdorder()) ?>">Edit</a>
&nbsp;
<a href="<?php echo url_for('order/index') ?>">List</a>
